<template>
  <view>
     <view class="title-warp">
      <uni-icons type="left" size="24" class="iconBack" @click="toPage"></uni-icons>
      <view class="txt">{{agreementInfo.configurationName}}</view>
     
    </view>
     <view v-html="agreementInfo.configurationContent" class="content"></view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        type:'',
        agreementInfo:{}
      };
    },
    onLoad(e) {
      this.type = e.type
      // this.id = e.id
      // this.index = e.index
    },
     onShow() {
      this.getAgreement(this.type)
    },
    methods:{
      getAgreement(val){
        let msg = val == '1'?"用户协议":'隐私协议'
         this.$tools.axiosFromToken('GET',`proconfigrich/getByName?name=${msg}`,'加载中').then(res => {
          	// this.$tools.showtt(res.msg)
          	if(res.code != 200) return
            this.agreementInfo = res.data
             console.log('this.res.data',res.data)
            console.log('this.agreementInfo',this.agreementInfo)

          	
          })
      },
      toPage(){
        uni.navigateTo({
          url:'/pages/login/login'
        })
      },
    }
  }
</script>

<style lang="scss">
.title-warp{
  position: fixed;
  z-index: 999;
  width: 100%;
  height: 160rpx;
  background: #fff;
  padding: 0 10rpx;
  display: flex;
  align-items: center;
  line-height: 240rpx;
  .iconBack{
    cursor: pointer;
    width: 10%;
    margin-top: 30px;
  }
  .txt{
    width: 80%;
    text-align: center;
     margin-top: 30px;
  }
  
}
.content{
    width: 100%;
    padding:100px  20px 20px;
  }
</style>